home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / GraphicsCards / StormMesa / mklib.glide < prev    next >
Text File  |  1998-12-15  |  2KB  |  90 lines

  1. #!/bin/sh
  2.  
  3. # Make a Linux ELF shared library, including 3Dfx Glide libs
  4.  
  5. #--identification------------------------------------------------------
  6.  
  7. # $Id: mklib.glide,v 1.8 1998/07/08 01:04:21 brianp Exp $
  8.  
  9. # $Log: mklib.glide,v $
  10. # Revision 1.8  1998/07/08 01:04:21  brianp
  11. # removed -lpthread.  MITS config now uses mklib.mits
  12. #
  13. # Revision 1.7  1998/06/22 01:53:15  brianp
  14. # added -lm -lpthread to GLIDELIBS for MITS
  15. #
  16. # Revision 1.6  1998/06/21 01:16:43  brianp
  17. # added patch to use libc5 on RedHat 5.x systems
  18. #
  19. # Revision 1.5  1997/12/07 17:18:21  brianp
  20. # removed -ltexus (David B)
  21. #
  22. # Revision 1.4  1997/10/21 23:32:31  brianp
  23. # now takes major and minor version arguments
  24. #
  25.  
  26. #--common--------------------------------------------------------------
  27.  
  28. # Usage:  mklib libname major minor file.o ...
  29. #
  30. # First argument is name of output library (LIBRARY)
  31. # Second arg is major version number (MAJOR)
  32. # Third arg is minor version number (MINOR)
  33. # Rest of arguments are object files (OBJECTS)
  34.  
  35. LIBRARY=$1
  36. shift 1
  37.  
  38. MAJOR=$1
  39. shift 1
  40.  
  41. MINOR=$1
  42. shift 1
  43.  
  44. OBJECTS=$*
  45.  
  46. #--platform------------------------------------------------------------
  47.  
  48. # If we're making the libMesaGL.so file then also link in the Glide libs.
  49. # The -L/usr/i486-linux-libc5/lib option is specified so that licb5 is
  50. # used on RedHat 5.x systems.  This helps to fix Quake problems.  This
  51. # tip comes from Emil Briggs (briggs@tick.physics.ncsu.edu).  Thanks!
  52. if [ $LIBRARY = "libMesaGL.so" ] ; then
  53.     GLIDELIBS="-L/usr/local/glide/lib -lglide2x -L/usr/i486-linux-libc5/lib -lm"
  54. fi
  55.  
  56.  
  57. # the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de)
  58.  
  59. VERSION="${MAJOR}.${MINOR}"
  60.  
  61. LIBNAME=`basename $LIBRARY`
  62. ARNAME=`basename $LIBNAME .so`.a
  63. DIRNAME=`dirname $LIBRARY`
  64.  
  65. gcc -shared -Wl,-soname,${LIBNAME}.${MAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS} ${GLIDELIBS}
  66. (cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${MAJOR})
  67.  
  68. ln -s ${LIBNAME}.${MAJOR} ${LIBRARY}
  69.  
  70.  
  71. # also make regular .a files,
  72. # provided by Danek Duvall (duvall@dhduvall.student.princeton.edu)
  73.  
  74. ar ruv ${DIRNAME}/${ARNAME} ${OBJECTS}
  75. ranlib ${DIRNAME}/${ARNAME}
  76.  
  77.  
  78. # Print a reminder about shared libs:
  79. DIR=`cd .. ; pwd`
  80. echo
  81. echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable"
  82. echo
  83. sleep 2
  84.  
  85.  
  86.  
  87. #### NOTES:
  88. # One Mesa user reports having to run the "ldconfig -v" command to make
  89. # Linux aware of the shared libs.
  90.